package com.xbongbong.pro.statistic.result.pojo.dto;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;

/**
 * 统计结果多条线的数据参数信息
 * @author zcp
 * @version v1.0
 * @date 2019/4/22 21:05
 * @since v1.0
 */
@Getter
@Setter
@ToString
public class StatisticResultDTO implements Serializable {
    private static final long serialVersionUID = 8994976664941294983L;

    /**
     * 统计结果各个线的信息
     */
    private List<StatisticResultInfoDTO> statisticResultInfoDtoList;
    //----------以下为该图的总信息（多个线一张图的总信息），如总数、总数的标题
    /**
     * true代表有总数，且总数值为value；false则无右侧总数
     */
    private Boolean totalFlag;
    /**
     * 冗余字段，用于存单个图右侧的总数
     */
    private String value;
    /**
     * 穿透的条件，该值不传或为空字符串时，则代表不能穿透
     */
    private String through;
    /**
     * 总数对应的标题（如图表中心图右侧的总数）
     */
    private String valueTitle;

    public StatisticResultDTO(String value, List<StatisticResultInfoDTO> statisticResultInfoDtoList) {
        //默认无总数
        this.totalFlag = false;
        this.value = value;
        this.valueTitle = null;
        this.statisticResultInfoDtoList = statisticResultInfoDtoList;
    }

    public StatisticResultDTO(boolean totalFlag, String value, String valueTitle, List<StatisticResultInfoDTO> statisticResultInfoDtoList) {
        this.totalFlag = totalFlag;
        this.value = value;
        this.valueTitle = valueTitle;
        this.statisticResultInfoDtoList = statisticResultInfoDtoList;
    }

    public StatisticResultDTO(boolean totalFlag, String value, String through, String valueTitle, List<StatisticResultInfoDTO> statisticResultInfoDtoList) {
        this.totalFlag = totalFlag;
        this.value = value;
        this.through = through;
        this.valueTitle = valueTitle;
        this.statisticResultInfoDtoList = statisticResultInfoDtoList;
    }
}
